﻿using System;
using System.Configuration;
using System.Data.SqlClient;
using HRM.DAL.DAO;

namespace HRM.DBGatway
{
    public class DbGateway
    {
        private SqlCommand commandObj;
        private SqlConnection connectionObj;

        public DbGateway()
        {
            connectionObj = new SqlConnection(GetConnention());
            commandObj = new SqlCommand();
        }
        public SqlConnection ConnectionObj
        {
            get
            {
                return connectionObj;
            }
        }

        public SqlCommand CommandObj
        {
            get
            {
                commandObj.Connection = connectionObj;
                return commandObj;
            }
        }
        private String GetConnention()
        {
            return ConfigurationManager.ConnectionStrings["HRMDBContext"].ConnectionString;
        }

    }
}